package com.spzx.product.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.spzx.domain.Brand;
import com.spzx.product.mapper.BrandMapper;
import com.spzx.product.service.IBrandService;
import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 品牌Service业务层处理
 */
@Service
public class BrandServiceImpl implements IBrandService {


    @Autowired
    private BrandMapper brandMapper;

    @Override
    public int insertBrand(Brand id) {
        return brandMapper.insert(id);
    }

    @Override
    public int updateBrand(Brand id) {
        return brandMapper.updateById(id);
    }

    @Override
    public Brand selectBrandById(Long id) {
        return brandMapper.selectBrandById(id);
    }

    @Override
    public int deleteBrandById(Long[] ids) {
        return brandMapper.deleteBrandById(ids);
    }


    @Override
    public IPage<Brand> getBrandAll() {
        return brandMapper.selectPage(getBrandAll().setSize(3).setTotal(2), null);
    }
}
